<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:o="http://openfaces.org/"
      xmlns:ui="http://java.sun.com/jsf/facelets">

    <head>
    </head>
    <body>
        <ui:composition template="/templates/default.xhtml">
			<ui:define name="title">OpenHDS - Edit Pregnancy Observation</ui:define>        
        
			<ui:param name="crud" value="#{pregnancyObservationCrud}" />
		
            <ui:define name="listing">
                <ui:include src="list.xhtml" />
            </ui:define>
            <ui:define name="display">
            
            	<h:outputText value="#{navController.breadcrumbTrail}" />
            
                <h1>#{msg.pregnancyObservationEdit}</h1>
                <h:messages id="errors" globalOnly="true" />
                <h:form id="form">
                    <h:panelGrid columns="3">
                       
                        <h:outputText value="#{msg.pregnancyObservationMotherId}:"/>
                        <h:inputText styleClass="individual" autocomplete="off" id="mother" value="#{pregnancyObservationCrud.item.mother}" converter="#{individualExtIdConverter}" disabled="true"/>
                        <h:message for="mother" errorClass="error" errorStyle="color: red" infoStyle="color: green"/>

                        <h:outputText value="#{msg.pregnancyObservationEDD} (#{siteProperties.dateFormat})" />
                        <o:dateChooser id="deliveryDate" value="#{pregnancyObservationCrud.edd}" pattern="#{siteProperties.dateFormat}" />
                        <h:message for="deliveryDate" errorClass="error" errorStyle="color: red" infoStyle="color: green"/>

                        <h:outputText value="#{msg.pregnancyObservationRecordedDate} (#{siteProperties.dateFormat})" />
                        <o:dateChooser id="recordedDate" value="#{pregnancyObservationCrud.recordedDate}" pattern="#{siteProperties.dateFormat}" />
                        <h:message for="recordedDate" errorClass="error" errorStyle="color: red" infoStyle="color: green"/>

                        <h:outputText value="#{msg.fieldWorkerId}:"/>
                        <h:inputText styleClass="collectedBy" autocomplete="off" id="collectedBy" converter="#{fieldWorkerExtIdConverter}" title="#{msg.tipFWExtId}" value="#{pregnancyObservationCrud.item.collectedBy}" />
                        <h:message for="collectedBy" errorClass="error" errorStyle="color: red" infoStyle="color: green"/>
		                
		                <h:outputText value="#{msg.visitId}:"/>
		                <h:inputText styleClass="visit" autocomplete="off" id="visit" converter="#{visitExtIdConverter}" value="#{pregnancyObservationCrud.item.visit}" />
		                <h:message for="visit" errorClass="error" errorStyle="color: red" infoStyle="color: green"/>
                    </h:panelGrid>
                    <script>
  						document.getElementById('form:deliveryDate').focus();
  					</script>
                    <br />
                    <h:commandButton action="#{pregnancyObservationCrud.edit}" value="#{msg.lblSave}">
                        <f:setPropertyActionListener target="#{jsfService.itemId}" value="#{pregnancyObservationCrud.item.uuid}" />
                    </h:commandButton>
                    <h:outputText value=" " />
                    <h:commandButton value="Cancel" immediate="true" action="cancel" rendered="#{flowScope.updating}" />
                </h:form>
            </ui:define>
        </ui:composition>
    </body>
</html>

